package com.bread.tliaswebmanagement.utils;

//用于操作当前线程的线程局部变量
public class CurrentHolder {

    private static final ThreadLocal<Object> CURRENT_LOCAL = new ThreadLocal<>();

    public static void setCurrentId(Integer employeeId) {
        CURRENT_LOCAL.set(employeeId);
    }

    public static Integer getCurrentId() {
        return (Integer) CURRENT_LOCAL.get();
    }

    public static void remove() {
        CURRENT_LOCAL.remove();
    }

    public static void set(Object obj){
        CURRENT_LOCAL.set(obj);
    }

    public static Object get(){
        return CURRENT_LOCAL.get();
    }

}
